package Test1;

import Final.Delete;
import Final.Update_1;
import Test1.Select_Menu;

import javax.swing.*;
import java.awt.*;

class menu extends JFrame{
    public menu(){
        JFrame jFrame = new JFrame();

        JPanel jp = new JPanel();
        jFrame.add(jp);
        jp.setOpaque(false);
        jFrame.setSize(500,400);
        Container cp = jFrame.getContentPane();
        cp.setLayout(null);
        ImageIcon img = new ImageIcon("D:\\Code\\java\\课设\\背景.jpg"); //相对路径获取图片
        ((JPanel)cp).setOpaque(false);
        JLabel background = new JLabel(img);

        this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));

        background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight());



        JLabel j2=new JLabel("***欢迎登陆籍贯管理系统***");

        JLabel j1=new JLabel("~~请在左侧选择所做的操作~~");

        JButton b1=new JButton("查询");

        JButton b2=new JButton("取消");

        JButton b3=new JButton("修改");

        JButton b4=new JButton("增添");

        JButton b5=new JButton("删除");

        JTextArea t3=new JTextArea(150,150);

        cp.add(j2);

        j2.setBounds(220,110,190,25);

        cp.add(j1);

        j1.setBounds(220,150,190,25);

        cp.add(b1);

        b1.setBounds(0, 70, 90, 25);

        cp.add(b2);

        b2.setBounds(250, 250, 70, 25);

        cp.add(b4);

        b4.setBounds(0,110,90,25);

        cp.add(b3);

        b3.setBounds(0,150,90,25);

        cp.add(b5);

        b5.setBounds(0,190,90,25);

        //b2.addActionListener(new ActionListener() {

        //取消则关闭窗口
        jFrame.setVisible(true);

        b2.addActionListener(e -> {

            jFrame.dispose();

        });

        b1.addActionListener(e -> {

            new Select_Menu();

        });

        b3.addActionListener(e -> {

            new Update_1();
        });

        b4.addActionListener(e -> {

            //new Insert();

        });

        b5.addActionListener(e -> {

            new Delete();

        });
    }


}
